package com.yale.elasticsearch.controller.query;

import com.yale.elasticsearch.dto.RangeQueryDTO;
import com.yale.elasticsearch.service.query.RangeQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author :yale
 * @date : 2024/8/1
 */
@Api(tags = "查询-范围查询")
@RestController
@RequestMapping("/query")
public class RangeQueryController {

    @Resource
    private RangeQueryService rangeQueryService;

    @ApiOperation(value = "范围查询", notes = "范围查询")
    @PostMapping("/range")
    public Object rangeQuery(@Valid @RequestBody RangeQueryDTO rangeQueryDTO) {
        return rangeQueryService.rangeQuery(rangeQueryDTO);
    }

//    @ApiOperation(value = "时间范围查询", notes = "时间范围查询")
//    @PostMapping("/dateRange")
//    public Object dateRangeQuery() {
//        return rangeQueryService.dateRangeQuery();
//    }
}
